export function mymap(ak) { // 此处ak 是你百度地图获取的密钥
  return new Promise(function(resolve, reject) {
    window.init = function() {
      resolve(mymap)
    }
    var script = document.createElement('script')
    script.type = 'text/javascript'
    script.src = `https://webapi.amap.com/maps?v=1.4.2&plugin=AMap.Geolocation,AMap.Geocoder,AMap.Autocomplete,AMap.GeometryUtil&key={$ak}`
    script.onerror = reject
    document.head.appendChild(script)
  })
}

